using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class RaceManager {
	
	static string typeName = typeof(Race).ToString();
	
	static GenericManager<Race> _m;
	
	static GenericManager<Race> m
	{
		get
		{
			if(_m == null)
				_m = new GenericManager<Race>(typeName);
			return _m;
		}
	}
	public static Dictionary<string,string> index
	{
		get
		{
			return m.index;
		}
	}
	
	public static bool SaveRace(Race a, string file)
	{
		return m.SaveObject(a,file);
	}

	public static Race AddRace(	string name, string description, string size, List<string> racialAbilities, int STRMod = 0, 
								int DEXMod = 0, int CONMod = 0, int INTMod = 0, int WISMod = 0, int CHAMod = 0, int Speed = 30, bool Quadruped = false)
	{
		Race a = new Race();
		a.name = name;
		a.description = description;
		a.Size = size;
		a.Speed = Speed;
		a.Quadruped = Quadruped;
		a.STRMod = STRMod;
		a.DEXMod = DEXMod;
		a.CONMod = CONMod;
		a.INTMod = INTMod;
		a.WISMod = WISMod;
		a.CHAMod = CHAMod;
		
		a.racialAbilities = racialAbilities;
		
		return m.AddObject(a);
	}
	
	
	public static void DeleteRace(string name)
	{
		m.DeleteObject(name);
	}
	
	public static Race Load(string name)
	{
		return m.LoadObject(name);
	}
	
	public static bool isCustom(string name)
	{
		return m.isCustom(name);
	}
}
